


Between Variation

by Bitenomnom



Series: Mathematical Proof [16]
Category: Sherlock (TV)
Genre: Fluff, Friendship, Gen, Johnlock goggles optional, Love, Mathematics, Sherlock tries to be secretive about his mother-henning, injured!John
Language: English
Status: Completed
Published: 2012-10-02
Updated: 2012-10-02
Packaged: 2017-11-15 11:41:27
Rating: Not Rated
Warnings: Creator Chose Not To Use Archive Warnings
Chapters: 1
Words: 2,378
Publisher: archiveofourown.org
Story URL: https://archiveofourown.org/works/526920
Author URL: https://archiveofourown.org/users/Bitenomnom/pseuds/Bitenomnom
Summary: <blockquote class="userstuff">
              <p>John is an extremely inconvenient variable in Sherlock's data analysis. He is also in hospital with a broken leg, but perhaps that's not surprising. What's more surprising is Sherlock's solution to both problems.</p>
            </blockquote>





	Between Variation

**Author's Note:**

> As tags indicate, Johnlock goggles entirely optional, as this can also be just an adorable fluffy friendship story.
> 
> It's just about time for midterms, so I think I should warn you ahead of time that entries for the next couple-few weeks may end up being rather short some days depending on how those go (take-home exams, so nothing as nice as tests that only last an hour or two...). I'm also trying to find some time to work on a Sherlock fanvid. Incidentally, since I doubt I've ever mentioned it here, I have made a fair few Sherlock fanvids. If you want to check them out, [here's my channel](http://www.youtube.com/user/MoonMouse) or I also post all of them [on my Tumblr](http://toasterfish.tumblr.com/search/Sherlock%20fanvid).

When performing an analysis of variance (ANOVA), you want to compare the amount of variation you can explain with your model to the amount of variation your model does not explain. We do this by comparing the residual sum of squares (also known as “within variation” or “within sum of squares” particularly in ANOVA) and the regression sum of squares (“between variation” or “between sum of squares” in ANOVA), which are both parts of the total sum of squares.

One type of analysis of variance is called “one-way” ANOVA, wherein you have one independent variable that (you believe) affects the dependent variable. You analyze qualitative values using dummy variables (discussed in [Touching](http://archiveofourown.org/works/515273)), and while you do have to only have one independent variable (thus “one-way”), you can have multiple categories that may require two or more dummy variables. (For instance, if you are analyzing types of jobs and have three types, you will need two dummy variables—but your only independent variable is “job type,” so it still counts as one-way ANOVA).

We can formulate a particular way to find the residual and regression sums of squares in this case. (Equations omitted for conciseness, but let me know if you’re interested in seeing them.) For the regression sum of squares (“between variation”), the part of the error we _can_ explain with the model, we may say that for this type of situation where we have multiple groups, we _can_ explain why data varies from group to group. (For instance, we can explain why one job type would have a higher income than another job type.) What we _can’t_ explain with our model, the residual sum of squares (“within variation”), is why the values vary inside a group. (For instance, why would fifty people with the same job type have different incomes?)

When performing an F-test to see how useful our model is, we are comparing the error we can explain to the error we can’t explain. If our model explains a lot more error than it doesn’t, the F value is large, and we probably need this model (as opposed to leaving that variable out). In this case, ideally there will be minimal within variation (variation we can’t explain, within groups) compared to between variation (variation we can explain, between groups).

 

***  
  
            John woke up in hospital.

            It wasn’t the first time, and it almost certainly wouldn’t be the last, but at least it was unusual enough to give him a bit of a start.

            He stretched his mind to retrieve vague memories of what had happened from the distant areas that he knew would not have been nearly so distant if he were completely conscious and didn’t have drugs flowing through his system.

            “Ah, you’re up,” a muffled voice from beside him said. John turned his head and squinted.

            “Sherlock,” he mumbled.

            “Oh, good, you remember me,” Sherlock rolled his eyes, but his movements were just exaggerated enough that even in his state John could tell Sherlock had actually been concerned about that as a possible outcome.

            “I take it I hit my head, then.”

            “You don’t remember discussing it before, do you?”

            “No,” he stretched for the memory, “no, I don’t think so. Not right now, anyway.”

            “You also broke your leg.”

            “Oh. Right,” John glanced down to the cast over his left leg. Sherlock was going to be severely put out over _that_. Still, however self-sufficient he wanted to think he could be, it wouldn’t be a good idea for John to be ambling about all on his own, up and down stairs on crutches, especially with his shoulder. “I’ll see if I can get someone to stay over for a while to help me out. Or I can go to their place, if you don’t want them around, which is—”

            “Someone else? That’s highly impractical. I daresay I shall prove more than adequate.”

            “You’ll be busy with your cases,” John said. _And the second I ask you to grab something from the top shelf for me you’ll balk._ “And, uh, I’m sure you’ve already deduced that I won’t be able to run around London with you until I’ve recovered, so you’ll have to do them without me.”

Sherlock sighed theatrically. “Lestrade is two steps ahead of you. He has stated quite clearly that I will not be allowed to any crime scenes until you are able to accompany me. He seems to believe I would make you come along, or else abandon you for days at a time.”

            _Probably true_ , John thought, _not that you’d do it maliciously._ “That’s thoughtful of him.”

            “I’m sure the Yard would not appreciate any paperwork involved if you were to sustain additional injury during work on a case.”

            “Right,” John smiled. Of course Sherlock would be a little too bitter about being deprived of cases to want to acknowledge that Greg might just be doing something for John out of the goodness of his own heart. “I hope you’ll have something to keep you entertained?”

            “He’ll still bring files over, and will inevitably request my assistance through emails, calls, and text messages. I am merely not allowed on the scenes.” John severely doubted that when Sherlock started out his work as a consulting detective he was _ever_ allowed at the crime scenes. Knowing Sherlock, he simply swooped in, strutted about making his deductions, and left before anyone could quite process what had happened. Perhaps Greg had just gotten used to it over the years and gradually started asking for help. Or perhaps there was something more—but John doubted Sherlock was the one to ask about that, if it was the case.

            John tilted his head to stare at Sherlock. “Have you been here since…how long has it been?”

            “Eight hours. I’ve been in and out,” Sherlock answered, and he pressed his fingertips together beneath his chin, his eyes boring into John. “I’ve been thinking.”

            “Will the surprises never end?” John grinned. “What about? The case?”

            “Yes—and no. You recall, I hope, how I had solved this latest case, prior to your injury?”

            “You mean how you figured out which bloke we needed to chase through a rubbish dump? Yeah. It was how he cut his steak, wasn’t it?”

            “Exactly,” Sherlock lifted his chin from his fingers. “I was able to conclude that he was a doctor, as you no doubt remember.”

            “Do I cut my food like that?”

            Sherlock resumed his pensive pose, drawing his legs up onto the chair and pulling them up to his elbows. “In fact, that was my first question as well. The first of many.”

            “I’m not sure I see where you’re going with this,” John said. _As usual._

            “John, my work depends on the ability to make generalizations. What sort of clothes do news reporters wear? How does a guilty party’s gait vary when he passes a location similar to that of his offense? What type of salad does a veterinarian prefer? And so on.

            “These are useful nine times out of ten, even ninety-nine out of one hundred, in determining important characteristics of the person in question. It is simply the case that within particular groups, there are some things that hardly ever vary—not frequently enough to be considered, anyway.”

            “Right, as in, ‘oh, Caesar with salad cream, and look at that pen in her pocket, must be a veterinarian or an accountant,’” John summarized.

            “That’s ridiculous, John, an accounta—” he paused at John’s pointed stare. “Yes, in that general vein.”

            “And that’s what you’ve been thinking about? ‘John slices into ham just so; therefore he must be a stupidly tolerant flatmate?’”

            “I was talking about doctors.”

            “Ah, right. ‘Therefore he must be an excellent doctor whose advice I should take now and again’?” John added with a wry smirk.

            Sherlock shifted in his seat. “Of course I easily deduced that you are a doctor when we first met, but it was a bit of a stroke of luck given the setting and the conversation you happened to be having with Stamford. Nonetheless, I could easily deduce it a number of other ways, particularly after extended time with you.”

            “Yes, yes, I know. Are we just fishing for compliments now?” John raised an eyebrow.

            “You fit into some of your various categories somewhat poorly, John. One interferes with the other, and so on.” He seemed distressed by this. “My data is, frankly, useless when you add so much variance to the groups you occupy. You fit particularly horribly into ‘flatmate.’”

            “What do you mean?” John frowned. “For god’s sake, Sherlock, I let you re-label the crisper drawer _‘Body Parts (Human)’_ because you didn’t want to mix up your pureed livers, _because you had two different types of pureed livers in our refrigerator._ ”

            “Exactly! I can’t use that data! That’s not even _close_ to the range of typical flatmate behavior.”

            John sighed and lifted his head slightly to throw it back on the pillow, mostly for dramatic effect. He immediately regretted the decision at the dull ache in his neck and on the back of his skull, no doubt lessened by painkillers. “So what do you want me to do about it, Sherlock? Any time you want to stop keeping body parts in the refrigerator is _perfectly fine_ with me, trust me.”

            “You need to be removed from your various categories,” Sherlock said instead, completely failing to acknowledge John’s suggestion. John froze at the implication.

            “Are you…kicking me out?”

            Sherlock looked to John as if he had just remembered he was there, his eyes wide with confusion, as if John had spoken another language. “Did I ever say such a thing?”

            “Well, you sort of said you’re _removing me_ from at least the _flatmate_ category,” John’s voice rose, though whether it was due to anger or panic, he couldn’t tell. Between the drugs in his body and his rapid shift in mood, he was almost unbearably lightheaded and his heart felt like it was preparing to burst through his ribcage and make a run for it. “What _else_ am I supposed to make of that, Sherlock?”

            “Something reasonable, for a start!” Sherlock exclaimed almost as loudly, hands shuffling through his hair. He took a series of deep breaths and folded his hands again before he gathered himself and spoke. “I am simply placing you into your own category. A ‘John’ category, as it were.”

            “Oh.” John willed himself to still, and wished his face would return to its usual, less-red-than-at-present shade. “Right. Er—thank you?” he guessed. Sherlock valued the unusual, so certainly this must be a compliment?

            Sherlock’s feet returned the floor and he leaned forward, resting his elbows on his knees and folding his hands under his chin again. “Of course, this means I have a great deal many more observations to make about the ‘John’ category and what it entails. For instance, it has been my impression that doctors abhor me.”

            “Can’t imagine why.” John rolled his eyes.

            “Yet, observations indicate that you do not.”

            “No,” John said. “No, I definitely don’t hate you.” Sherlock inched closer, his arse now barely clinging to the chair as his gaze continued to bore into John. “What else does the John category entail?”

            “Anything you’d like,” Sherlock said quietly, his mind apparently in overdrive as his eyes darted over John’s face for any sign of a reaction. “Absolutely anything.”

            “Mm,” John couldn’t contain an upward twitch of his lips. “I see. Sounds promising. _Anything_?” He focused his attention on the ceiling. “An example, if you don’t mind?”

            Sherlock took in a slow breath. “For instance, if it is typical for an individual in the ‘John’ category to require his associated counterpart in the ‘Sherlock’ category to retrieve some take-away for dinner, you should inform me at the appropriate point in time.”

            John broke into a smile and closed his eyes, content. “All right. ‘John’ will tell his ‘Sherlock’ when to fetch us some dinner.”

            Sherlock placed a hand on John’s shoulder and squeezed lightly. “And ‘Sherlock’ will tell his ‘John’ when he ought to get some more rest.” A laugh trickled from John’s throat. “Right now, for instance. Get some sleep, John. This place smells awful and I have pureed livers to test at 221B which they would probably frown upon me bringing here.”

            “Good deduction,” John mumbled.

            “So get well enough that we can go back soon.”

            “I’ll get to work on it straight away.”

            Sherlock, of course, could have just gone back to the flat on his own for the night (or day, or whatever it was), John thought as his mind began to leave the hospital bed for someplace a little more restful. But then, Sherlock probably wanted data about how much individuals in the ‘John’ category slept after considerable injury. Sherlock’s hand remained on his shoulder for a few more moments before gently sliding back, as if Sherlock expected that John was already asleep and its sudden removal might wake him.

            John heard the door swing open. “Sherlock, thought you might be here.” It was Greg. “How’s he doing?”

            “He was just awake,” Sherlock answered quietly. “He’s going back to sleep as we speak. He’s fine.”

            “If you want to leave him be for a couple of hours, I actually have—” Greg stopped suddenly, and John cracked an eye open to see Sherlock holding a hand up before shutting his eye again.

            “As I recall,” Sherlock said, “you quite vehemently insisted that I will not be going to any crime scenes while John is recovering, for fear I will do something stupid, like bring him along and get him injured or make him try to fetch biscuits off the top shelf whilst on crutches while I’m gone.”

            “Oh,” Greg said, and then, “oh, right. Exactly.” He cleared his throat. “Don’t so much as entertain the idea of coming to any crime scenes until John’s out of his cast, you bloody idiot.”

            “Bring the case file later and I’ll have a look.”

            John cracked the other eye open this time, and Greg was smiling knowingly at Sherlock. “All right.” John couldn’t hold back a smile of his own as Greg left the room.

            Sherlock shifted in his seat. “Go to sleep, John.”

            And he did.


End file.
